#pragma once

#include "creature.hpp"
#include "grass.hpp"

class Sheep : public Creature
{
public:
    Sheep()
    {
        this->m_type = CT_SHEEP;
        this->m_sight = 2; // 让羊的行动范围小一些
    }

    virtual Event *run()
    {
        std::cout << "Sheep " << m_id << " run." << std::endl;
        // TODO 羊的生存规则，HP减少，判断HP和饥饿值，然后决定是觅食还是生存

        // 看似一样，实际不同类可以有差异，或者将一样部分放基类的run先调基类动作也行
        this->m_hunger += 10;

        if (m_hunger >= 100)
        {
            this->die();
            return nullptr;
        }

        return nullptr;
    }

    virtual bool can_eat(Creature *c)
    {
        return (c != nullptr && c->type() == CT_GRASS);
    }
};
